home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / 3dlib30a.zip / PROJECT3.INT < prev    next >
Text File  |  1994-03-10  |  4KB  |  77 lines

  1. (******************************************************************************
  2. *                                  project3                                   *
  3. ******************************************************************************)
  4. unit project3;
  5.  
  6. (*******************************************************************************
  7. *      this unit has 2 instances : the first one is used with the windows      *
  8. *               graphic user interface, and the other does not,                *
  9. *                                                                              *
  10. *             +-------------------------------------------------+              *
  11. *             |  this unit is NOT interfaced to the window GUI, |              *
  12. *             |   for use on a bare screen ONLY - for runTime!  |              *
  13. *             |                ****                             |              *
  14. *             +-------------------------------------------------+              *
  15. *                                                                              *
  16. *this unit handles the 3d -> 2d projections, we use 2 different methods        *
  17. *       of projections :                                                       *
  18. *                                                                              *
  19. *               A : axonometric projections, no perspective due to             *
  20. *                       distance is performed, the general way                 *
  21. *                       we can look at the coordinate system is as             *
  22. *                       follows :                                              *
  23. *                                                                              *
  24. *                               |  z axis                                      *
  25. *                               |                                              *
  26. *                              / \                                             *
  27. *                    x axis   /   \  y axis                                    *
  28. *                                                                              *
  29. *               B : perspective projections : the normal eye perspective       *
  30. *                       projection is performed, we can look at the 3d         *
  31. *                       universe we are refering to as a cube of               *
  32. *                       1000 x 1000 x 1000 integer locations, with             *
  33. *                       the x axis, and y axis parallel to the screen          *
  34. *                       x, y axis respectivly, and the z axis going into       *
  35. *                       the screen.                                            *
  36. *                                                                              *
  37. *                       we will look at the coordinate system as follows :     *
  38. *                                                                              *
  39. *                       │ Y axis                                               *
  40. *                       │                                                      *
  41. *                Z axis x------ X axis                                         *
  42. *                                                                              *
  43. *                                                                              *
  44. *******************************************************************************)
  45.  
  46. interface
  47.  
  48. uses  
  49. {$ifndef windows}  
  50.  {$ifndef os2}
  51.    graph,
  52.  {$endif}
  53. {$endif}
  54.    hdr3d
  55.    ;
  56.  
  57. const
  58.         perspective     : boolean = false; 
  59.         {true = perspective, else = axonometric}
  60. {$ifndef windows}
  61.  {$ifndef os2}
  62. var
  63.     MaxX, MaxY : word;          { In pixels for graphics screen }
  64.     MaxColor   : word;
  65.     GraphDriver           : integer;
  66.     GraphMode             : integer;
  67.  {$endif}
  68. {$endif}
  69.  
  70. procedure calcPoint(p3d : point3d; var psc : screenPoints);
  71. procedure setPerspective;
  72. procedure resetPerspective;
  73. procedure togglePerspective;
  74.  
  75. implementation
  76. end.
  77.